package xyz.xiangyushui.controller.employeeLeader;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import xyz.xiangyushui.dao.commodity.CommodityDao;

/**
 * Servlet implementation class NewWeeklyPlan
 */
@WebServlet("/employeeLeader/salesPlan/create")
public class NewSalesPlan extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private CommodityDao cd;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public NewSalesPlan() {
		super();
		cd=new CommodityDao();
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setAttribute("commodities", cd.getAllCommodityIdAndName());
		request.getRequestDispatcher("/employeeLeader/salesPlan/new.jsp").forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		// response.getWriter().append(request.)
		 doGet(request, response);
	}

}
